package com.example.fitnessapp.controller;



import com.example.fitnessapp.util.ApiResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/incentive")
@RequiredArgsConstructor
public class IncentiveController {
    @GetMapping("/streak/{userId}")
    public ApiResponse<Map<String, Integer>> streak(@PathVariable String userId) {
        Map<String, Integer> data = new HashMap<>();
        data.put("streakDays", 7);
        return ApiResponse.ok("success", data);
    }

    @GetMapping("/reward/{userId}")
    public ApiResponse<List<Map<String, Object>>> reward(@PathVariable String userId) {
        List<Map<String, Object>> rewards = new ArrayList<>();
        Map<String, Object> r = new HashMap<>();
        r.put("rewardId", "rw001");
        r.put("type", "streak");
        r.put("desc", "连续7天打卡奖励");
        r.put("date", "2024-06-07");
        rewards.add(r);
        return ApiResponse.ok("success", rewards);
    }
}
